<template>
  <el-dialog v-dialogDrag :visible.sync="dialogVisible" title="入库详情" width="1000px">
    <button-group ref="buttonGroup" @cancel="dialogVisible = false" />
    <el-row>
      <div class="detailsTop">
        <span>入库详情单</span>
        <el-divider content-position="right">{{ ruleForm.planNo }}</el-divider>
      </div>
      <div class="detailCont detailDialogFont threeDetailStyle">
        <ul>
          <li>
            <b>计划单号</b>
            <span>{{ ruleForm.planNo }}</span>
          </li>
          <li>
            <b>排程单号</b>
            <span>{{ ruleForm.scheduleNo }}</span>
          </li>
          <li>
            <b>物料</b>
            <span>{{ ruleForm.materialName }} {{ruleForm.materialCode ? '【' + ruleForm.materialCode + '】':''}}</span>
          </li>
          <li>
            <b>单位</b>
            <span>{{ ruleForm.unit }}</span>
          </li>
          <li>
            <b>作业车间</b>
            <span>{{ ruleForm.factoryName }}</span>
          </li>
          <li>
            <b>任务数量</b>
            <span>{{ ruleForm.taskNum }}</span>
          </li>
          <li>
            <b>已入库数</b>
            <span>{{ ruleForm.totalInNum }}</span>
          </li>
          <li>
            <b>入库类别</b>
            <span>{{ ruleForm.inType }}</span>
          </li>
        </ul>
      </div>
      <el-table border class="tabOver" stripe height="350px" :data="ruleForm.details">
        <el-table-column prop="inNo" label="入库单号" align="center" />
        <el-table-column prop="inNum" label="入库数量" width="100px" align="center" />
        <el-table-column prop="inUserName" label="入库人" width="150px" align="center" />
        <el-table-column prop="wmsName" label="入库库位" width="150px" align="center" />
        <el-table-column prop="inDate" label="入库时间" align="center" width="200px" />
        <el-table-column prop="inBatch" label="入库批号" width="150px" align="center" />
      </el-table>
    </el-row>
    <bottom-font ref="bottomFont" :obj-name="ruleForm.details.length > 0 ? ruleForm.details[0].inUserName : this.$store.getters.compInfo.userName" :obj-date="ruleForm.details.length > 0 ? ruleForm.details[0].inDate : ''" />
  </el-dialog>
</template>
<script>
import bottomFont from '@/components/BottomFont'
export default {
  components: { bottomFont },
  props: {},
  data() {
    return {
      ruleForm: {
        details: []
      },
      dialogVisible: false
    }
  },
  watch: {},
  mounted() {},
  methods: {
    /**
     * @description: 获取详情
     * @param {*} row
     * @return {*}
     */
    async showDialog(row) {
      this.getDetail(row.id)
      this.dialogVisible = true
    },
    /* 编辑获取详情 */
    async getDetail(id) {
      const res = await this.$axios.get(`/pro/put/detail?id=${id}`)
      if (res.data.code === 200) {
        this.ruleForm = res.data.data
      }
    }
  }
}
</script>
<style lang='scss' scoped>
.demo-table-expand {
  font-size: 0;
}
.demo-table-expand label {
  width: 90px;
  color: #99a9bf;
}
.demo-table-expand .el-form-item {
  margin-right: 0;
  margin-bottom: 0;
  width: 50%;
}
</style>
